Skip to content

fix(cli): os g object places its field through the group's fields list, as the starter does - #37595

Draft
objectstack-fleet[bot] wants to merge 3 commits into
mainfrom
claude/area-o1A-37503
Draft

objectstack-fleet[bot] wants to merge 3 commits into
mainfrom
claude/area-o1A-37503

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #37503
Clause-②: no
Metadata-protocol: none

维护者速读

  • 开发者用命令行新建对象时,生成的文件现在和新项目自带的公司、联系人对象写法一致:字段改由分组的字段清单放入分组;文档里的命令输出示例换成了公司和联系人,入门页说明当前正式版仍生成旧的笔记项目。
  • 为什么做:新项目模板已换成公司和联系人(上游模板替换的后续),生成器"与模板同一写法"的承诺在字段放置上失效了,文档和注释也还在讲旧的笔记对象。
  • 出错会怎样:只影响新生成的对象文件写法,两种写法含义相同、都能通过校验;已有项目不变,可直接撤回。
  • 要你做什么:无

What changes

  1. os g object places its field the way the starter does. The object generator now writes fieldGroups: [{ key: 'details', label: 'Details', fields: ['name'] }] after the field map, and the name field no longer carries group: 'details'. Measured on origin/main c385d3b: examples/app-starter/src/objects/company.object.ts and the blank template's company.object.ts / contact.object.ts place every field through a group's fields list and carry no per-field group (zero group: lines). The spec calls the list "the current spelling" (ObjectFieldGroupSchema.fields: "new metadata lists members here"). The generated comment now tells the author to list each added field in a section, and the doc comment cites the starter's current files instead of note.object.ts. Route: the generator follows the starter, as the os generate: generated metadata uses a different authoring style from the scaffold and docs, and four generators trap newcomers #32153 pin promises; the promise is not narrowed.
  2. content/docs/deployment/cli.mdx: the os compile and os info transcripts come from a real run of the current blank template plus the ticket object, view and action from Build with Claude Code (companies, contacts, the starter app, zero rows now printed, no plugins). The callout describing the fixture is rewritten to match. The "Create a project" step no longer says "a sample object".
  3. Getting-started pages: your-first-project.mdx and build-with-claude-code.mdx each get one callout sentence: npm create objectstack@latest installs create-objectstack 18.6.0 today, which still scaffolds the note project, and the companies-and-contacts template ships with 19.0. The stale "One object, REST API" template row in your-first-project.mdx now carries the template's real description.
  4. Stale comments only in init-scaffold-file-name-registry-parity.test.ts, platform-object-names.test.ts, blank-template-console-disclosure.test.ts (header) and starter-comments-self-contained.test.ts.

Read first, by risk:

  1. packages/cli/src/commands/generate.ts, the object template string (the only behaviour change).
  2. packages/cli/test/generate-scaffold-validates.test.ts, the os generate: generated metadata uses a different authoring style from the scaffold and docs, and four generators trap newcomers #32153 pin's new expectations.
  3. content/docs/deployment/cli.mdx, the fixture callout under os info.

Tests

All readings on head 95d0446 (claude/area-o1A-37503), repo objectstack-ai/objectstack.

  • pnpm --filter @objectstack/cli exec vitest run --project unit --maxWorkers=2: Test Files 446 passed, Tests 6379 passed.
  • os generate: generated metadata uses a different authoring style from the scaffold and docs, and four generators trap newcomers #32153 pin (generate-scaffold-validates.test.ts): 26/26 pass. Ablation: with generate.ts restored to c385d3b the pin fails with expected undefined to deeply equal [ 'name' ]; restored to HEAD, green.
  • OS_TEST_TIERS=nightly, generate-scaffold-gates.e2e.test.ts -t 'fresh os init project': 11 passed (the generated object, then os validate / os build / os lint with zero findings, and the updated text assertion).
  • The four comment-only test files: 75 + 14 + 8 pass.
  • pnpm --filter @objectstack/cli typecheck: exit 0.
Real run behind the cli.mdx transcripts

Blank template scaffolded with this branch's create-objectstack bin, the ticket object, view and action copied verbatim from Build with Claude Code section 3 and renamed to my_app_:

  Data: 3 Objects  18 Fields
  UI: 1 Apps  3 Views  1 Actions
  Logic: 0 Flows
  Security: 0 Positions  0 Permissions
  Runtime: 0 plugins

  Objects:
    my_app_company (7 fields, user) — Company
    my_app_contact (7 fields, user) — Contact
    my_app_ticket (4 fields, user) — Ticket

The walkthrough's three os generate commands on a copy: all exit 0, summary Data: 4 Objects 19 Fields, UI: 1 Apps 3 Views 2 Actions, Logic: 1 Flows; os validate passes. The generated customer.object.ts carries { key: 'details', label: 'Details', fields: ['name'] } and no group: line.

Acceptance notes

  • The ticket view in Build with Claude Code section 3 declares an internal create and edit form; a real compile prints one form-view-internal-not-loaded warning for it, while the page says the form is where description is entered. The cli.mdx callout says so and leaves the warning lines out of the transcript. Open PR feat(spec)!: form is a metadata type of its own, and the form doors read a form over both types #37422 (form type) edits that page; reported only.
  • os init -t app (packages/cli/src/commands/init.ts) still writes per-field group: 'details'. Out of this card's file surface; both spellings are valid.
  • The blank template's own comment says "A field shows on the form only once a section lists it", but deriveFieldGroupLayout renders ungrouped fields in a trailing untitled section. Read-only inference, not measured in a browser; the generated comment here does not repeat the claim.
  • content/docs/deployment/validating-metadata.mdx shows a support-desk summary with Runtime: 3 plugins and no zero rows; not re-run, outside this surface.

Verification

Two minutes: node packages/cli/bin/run-dev.js generate object customer in a scaffolded project, then open src/objects/customer.object.ts. Expect { key: 'details', label: 'Details', fields: ['name'] } after fields, and no group: line on name.


Generated by Claude Code

…t, as the starter does

The blank template and the platform's Starter app now place every field by
naming it in a fieldGroups entry's `fields` list; the object generator still
wrote a per-field `group`. It now writes the starter's placement, and the doc
comment cites the starter's current files. Stale `note.object.ts` comments in
four test files are corrected.

Claude-Session: https://claude.ai/code/session_016WV4cyyekQEqLjtrCLLAeV
Co-authored-by: Claude <noreply@anthropic.com>
…l scaffolds the note project

Claude-Session: https://claude.ai/code/session_016WV4cyyekQEqLjtrCLLAeV
Co-authored-by: Claude <noreply@anthropic.com>
…and-contacts starter; changeset

Claude-Session: https://claude.ai/code/session_016WV4cyyekQEqLjtrCLLAeV
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation protocol:system tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cli, touching 2 documentable anchor(s).

16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 6c290d3af7c52d019d1de1c09b6b0306f09700bb.

⛔ 6 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 40 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 6c290d3af7c52d019d1de1c09b6b0306f09700bb → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 0e4251a8b46781b9b5185edf6b24afdbee105421 — the merge of head 95d0446c0d022b0aa1290f872d5292238e8f4581 into base 6c290d3af7c52d019d1de1c09b6b0306f09700bb, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 0e4251a8b46781b9b5185edf6b24afdbee105421 && git checkout 0e4251a8b46781b9b5185edf6b24afdbee105421
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6c290d3af7c52d019d1de1c09b6b0306f09700bb 95d0446c0d022b0aa1290f872d5292238e8f4581 && git checkout -B drift-repro 6c290d3af7c52d019d1de1c09b6b0306f09700bb && git merge --no-ff 95d0446c0d022b0aa1290f872d5292238e8f4581

node scripts/docs-audit/affected-docs.mjs --json 6c290d3af7c52d019d1de1c09b6b0306f09700bb

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 6c290d3af7c52d019d1de1c09b6b0306f09700bb → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4cyyekQEqLjtrCLLAeV

Red-check reading · 2026-11-26T14:53Z · head 95d0446c0d022b0aa1290f872d5292238e8f4581 · area o1-A

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:system size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

blank template is company/contact now: stale note citations and the generator's "starter style" promise for field placement (family)

2 participants